package nm.util.alarmclock;

import java.awt.event.ActionListener;

public class AlarmOptions {
	
	public AlarmOptions(ActionListener listener) {
		frame = new AlarmGUIFrame(listener, 
				AlarmSettings.getSettings(), AlarmSettings.HOME_DIR);
	}
	
	public AlarmSettings getSettings() {
		AlarmSettings s = AlarmSettings.getSettings();
		s.setHour(frame.getHour());
		s.setMinute(frame.getMinute());
		s.setSecond(0);
		s.setSound(frame.getSound());
		return s;
	}
	
	public AlarmGUIFrame getFrame() {
		return frame;
	}
	
	public void toggleSettings() {
		if(frame.isVisible())
		{
			frame.setVisible(false);
		}
		else
		{
			frame.setVisible(true);
			frame.toFront();
		}
	}
	
	//instance variables
	private AlarmGUIFrame frame;

}//end AlarmOptions
